package com.tester.zc.test002.thread;

import java.util.Random;

/**
 * 线程一
 *
 * @Author zhoucan
 * @Date 2022/12/11
 */
public class ThreadOne extends Thread{

    private static int output;

    public void run() {
        //生成1-10的随机数
        Random random = new Random();
        output = random.nextInt(10);
        System.out.println("随机给出1~10之间的一个整数:"+output);
    }
    //比大小
    public static String checkNum(int input) {
        if(input < output) {
            return "1";
        }else if(input > output){
            return "2";
        }else{
            return "0";
        }
    }
}
